package com.lgx.mall.basic.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lgx.common.exception.DataException;
import com.lgx.mall.basic.dao.IAddressDao;
import com.lgx.mall.basic.entity.Address;
import com.lgx.mall.basic.service.IAddressService;

/**
 * 
 * @author acer
 *
 */
@Service("addressService")
public class AddressService implements IAddressService {
	
	@Autowired
	private IAddressDao addressDao;

	public IAddressDao getAddressDao() {
		return addressDao;
	}

	/**
	 * 创建
	 * @see com.lgx.mall.basic.service.IAddressService#createAddress(com.lgx.mall.basic.entity.Address)
	 */
	@Override
	public Address createAddress(Address address) throws DataException {
		return this.addressDao.createAddress(address);
	}

	@Override
	public Address updateAddress(Address address) throws DataException {
		return this.addressDao.updateAddress(address);
	}

	@Override
	public void deleteAddress(Address address) throws DataException {
		this.addressDao.deleteAddress(address);
	}

	@Override
	public void deleteAddressById(long id) throws DataException {
		this.addressDao.deleteAddressById(id);
	}

	@Override
	public void deleteAddress(String[] ids) throws DataException {
		this.addressDao.deleteAddress(ids);
	}

	@Override
	public Address findAddressById(long id) {
		return this.addressDao.findAddressById(id);
	}

	@Override
	public List<Address> findAddressList(long userId) {
		return this.addressDao.findAddressList(userId);
	}

	@Override
	public List<Address> findAddressList(long userId, Integer isdefault) {
		return this.addressDao.findAddressList(userId,isdefault);
	}


}
